-
Notifications
You must be signed in to change notification settings - Fork 72
feat: Add prefilled email, password to SupaEmailAuth #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: maurovanetti <[email protected]>
Co-authored-by: maurovanetti <[email protected]>
Co-authored-by: maurovanetti <[email protected]>
Co-authored-by: maurovanetti <[email protected]>
- Extract _signInWithMagicLink() method in SupaMagicAuth - Extract _submitForm() method in SupaPhoneAuth - Extract _updatePassword() method in SupaResetPassword - Fix use_build_context_synchronously warnings by properly checking context.mounted - Fix sort_child_properties_last warnings by placing child parameter last - Reduces code duplication and improves maintainability Co-authored-by: maurovanetti <[email protected]>
…nt-auto-submit Add enableAutomaticFormSubmission flag to prevent automatic form submission on Enter key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for prefilled email and password values in the SupaEmailAuth component, along with comprehensive improvements to form submission behavior across all authentication components.
- Adds
prefilledEmail
andprefilledPassword
parameters to SupaEmailAuth for prepopulating form fields - Introduces
enableAutomaticFormSubmission
flag to control whether pressing Enter automatically submits forms - Updates dependencies and applies code formatting improvements across multiple components
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
lib/src/components/supa_email_auth.dart | Adds prefilled email/password support and enableAutomaticFormSubmission flag |
example/lib/sign_in_prefilled.dart | New example demonstrating prefilled values functionality |
lib/src/components/supa_phone_auth.dart | Adds enableAutomaticFormSubmission flag and refactors form submission logic |
lib/src/components/supa_magic_auth.dart | Adds enableAutomaticFormSubmission flag and refactors form submission logic |
lib/src/components/supa_reset_password.dart | Adds enableAutomaticFormSubmission flag and refactors form submission logic |
pubspec.yaml | Updates dependency versions (email_validator, sign_in_with_apple) |
README.md | Documents new form submission control behavior |
CHANGELOG.md | Documents the new enableAutomaticFormSubmission feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -1,3 +1,7 @@ | |||
## Unreleased | |||
|
|||
- feat: Add `enableAutomaticFormSubmission` flag to prevent automatic form submission when pressing Enter on on-screen keyboard in all auth components (SupaEmailAuth, SupaPhoneAuth, SupaMagicAuth, SupaResetPassword) |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog entry is missing documentation of the main feature mentioned in the PR title - the addition of prefilledEmail
and prefilledPassword
parameters to SupaEmailAuth.
- feat: Add `enableAutomaticFormSubmission` flag to prevent automatic form submission when pressing Enter on on-screen keyboard in all auth components (SupaEmailAuth, SupaPhoneAuth, SupaMagicAuth, SupaResetPassword) | |
- feat: Add `enableAutomaticFormSubmission` flag to prevent automatic form submission when pressing Enter on on-screen keyboard in all auth components (SupaEmailAuth, SupaPhoneAuth, SupaMagicAuth, SupaResetPassword) | |
- feat: Add `prefilledEmail` and `prefilledPassword` parameters to `SupaEmailAuth` to allow pre-populating the email and password fields. This is useful for deep linking or autofill scenarios. | |
```dart | |
SupaEmailAuth( | |
prefilledEmail: '[email protected]', | |
prefilledPassword: 'password123', | |
// other parameters... | |
) |
Copilot uses AI. Check for mistakes.
if (mounted) { | ||
setState(() { | ||
_phone.text = ''; | ||
_password.text = ''; | ||
}); | ||
} |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clearing form fields after successful submission in phone auth may not be the desired behavior. This differs from the email auth component which doesn't clear fields on success and could create inconsistent user experience.
if (mounted) { | |
setState(() { | |
_phone.text = ''; | |
_password.text = ''; | |
}); | |
} | |
// Do not clear fields after submission to match email auth behavior. |
Copilot uses AI. Check for mistakes.
What kind of change does this PR introduce?
It allows for prefilled values for email and/or password in
SupaEmailAuth
.What is the current behavior?
Currently, this value can only be inserted manually by the user.
What is the new behavior?
Unchanged if
prefilledEmail
andprefilledPassword
are not specified in the widget's constructor.If any of these values is set, the corresponding
TextEditingController
will be initialized with it.